package com.itheima.manager;


import com.itheima.service.db.IOrderService;
import com.itheima.vo.OmsOrderVo;
import com.itheima.vo.PageBeanVo;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
public class OmsOrderManager {

    @DubboReference
    IOrderService orderService;

    //分页查询
    public PageBeanVo findByPage(Map<String, String> map) throws ParseException {
        PageBeanVo pageBeanVo = orderService.findByPage(map);
        return pageBeanVo;
    }

    //查询详情
    public OmsOrderVo findById(Integer id) {
        OmsOrderVo omsOrderVo = orderService.findById(id);
        return omsOrderVo;
    }

    //订单备注
    public void note(Long orderId, String note, Integer status) {
        orderService.note(orderId,note,status);
    }

    //批量关闭
    public void close(List<Long> list, String note) {
        orderService.close(list,note);
    }

    //批量发货
    public void delivery(List<HashMap<String,String>> list) {
        orderService.delivery(list);
    }

    //修改收货人信息
    public void receiverInfo(HashMap<String, String> map) {
        orderService.receiverInfo(map);
    }

    //批量删除
    public void delete(List<Long> ids) {
        orderService.delete(ids);
    }
}
